<template>
  <ElInput :modelValue="props.modelValue"  @update:modelValue="onChangeStart" :disabled="disabled" type="number"></ElInput>
<!--  {{formData.data.baseSalary}}-->
<!--  {{modelValue}}-->
</template>

<script setup lang="ts">
import {ElInput} from 'element-plus'
import {computed, useAttrs, watch} from "vue";

const formData:Record<string, any> = useAttrs()
console.log('useAttrs', useAttrs())


interface Props {
  modelValue: number | null | undefined;
}

interface Emits {
  'update:modelValue': [number];
}

const props = defineProps<Props>()

const emits = defineEmits<Readonly<Emits>>()

let disabled = computed(() => {
  return formData.data.feeModel === 0
});

watch(() => disabled.value, () => {
  emits('update:modelValue', null); // 清空值
})

const onChangeStart = (e) => {
  emits('update:modelValue', e)
}
</script>
